package ua.com.abakumov.android.prostopleer.tasks

import android.util.Log
import ua.com.abakumov.android.prostopleer.engines.Engine
import ua.com.abakumov.android.prostopleer.util.Composition
import java.util.{List => JList}

class GTask(done: Done[JList[Composition]]) extends AsyncTaskWithCallback[Object, String, JList[Composition]](done) {

    protected override def onProgressUpdate(values: String*) {
        Log.i("GTask task says:", values.toString())
    }

    protected override def doInBackground(params: Object*): JList[Composition] = {
        params(1).asInstanceOf[Engine].search(params(0).asInstanceOf[String])
    }
}